package com.cmii.sjw.department.control.jsc.controller;

import com.cmii.sjw.department.control.jsc.model.base.SchoolData;
import com.cmii.sjw.department.control.jsc.model.params.SchoolInfoParams;
import com.cmii.sjw.department.control.jsc.service.SchoolService;
import com.cmii.sjw.department.control.jsc.util.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

/**
 * 学校数量统计Controller
 *
 * @author lizheng
 * @date 2024-11-15
 */
@RestController
@CrossOrigin
@RequestMapping("/school")
public class SchoolController {

    @Resource
    private SchoolService schoolService;

    /**
     * 学校数量统计
     * @return 获取json数据
     */
    @PostMapping("/getData")
    public Result<SchoolData> getData() {
        SchoolData data = schoolService.getData();
        return Result.success(data);
    }

    /**
     * 学校地图详细数据
     * @param params
     * @return
     */
    @PostMapping("/schoolMapDetailed")
    public Result SchoolMapDetailed(SchoolInfoParams params){
        return schoolService.schoolMapDetailed(params);
    }
}
